<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<style type="text/css">
body{font-size:12px;}
table{font-family:Courier,sans-serif;border-collapse:collapse;}
tr.border_bottom td {
  border-bottom:1pt solid #999;
  height:20px;
}

</style>
</head>
<body>
	<div class="mode">
		order id :
		<?=str_pad($order->id, 7, '0', STR_PAD_LEFT)?>
		<br> order time:
		<?=$order->order_time?>
		<br>
		<br> <img src="<?=base_url()?>resources/imgs/logo.png" width="200"><br>
		<?php if($order->reservation !=NULL){?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/calendar.png"/ > Réservation :
			<?=$order->reservation?>
		</h4>
		<?php }else{?>
		<h4>
			<img src="<?=base_url()?>/resources/imgs/flash.png" height="18"/> Commande Immédiate:
			<?=date('d-M-Y')?>
		</h4>
		<?php }?>


	</div>
	<div class="orders">
		<table align="center" width="100%">
			<tr bgColor="#eee">
				<td>Num</td>
				<td>Plat</td>
				<td>Options</td>
				<td>QTY</td>
				<td style="text-align: right;">Total</td>
			</tr>
			<?php foreach ($order_details as $item):?>
			<tr class="border_bottom">
				<td><?=$item->product_num?>
				</td>
				<td><?=$item->product_name?>
				</td>
				<td><?php if($item->option){?><?=$item->option?><?php }else{?>- - -<?php }?> </td>
				<td><?=$item->qty?>
				</td>
				<td style="text-align: right;"><?php echo $item->qty*($item->product_price+$item->additional_price) ;?> €</td>
			</tr>
			<?php endforeach;?>
		</table>
		<h4>
			Réduction:
			<?=$order->discount*100?>
			%
		</h4>
		<?php if($order->extra){?><h4>Frais supplémentaire: <?=number_format($order->extra,1,'.','')?> €</h4><?php }?>
		<h4>
			Total:
			<?php echo number_format($order->total*(1-$order->discount)+$order->extra,1,'.','');?>
			€
		</h4>
	</div>
	<hr>
	<?php if($order->order_type == 'delivery'):?>
	<h4>
		<img src="<?=base_url()?>/resources/imgs/car.png" height="20" /> Livraison:
		<?=$order->delivery_time?>
	</h4>
	Sonnette:
	<?=$address->ring?>
	<br>
	Société: <?=($address->company !=null) ? $address->company : '-------'?>
	<br> Adresse:
	<?=$address->house_num?>
	<?=$address->address?>
	<br> Commune:
	<?=$address->postal?>
	<?=$address->community?>
	<br> Téléphone:
	<?=$address->tele?>
	<?php endif;?>
	<?php if($order->order_type == 'take away'):?>
	<h4>
		<img src="<?=base_url()?>/resources/imgs/bag.png" height="15"/> Plat à emporter:
		<?=$order->takeaway_time?>
	</h4>
	<h4>
		Magazin: <?=$order->shop->shop_name?>,  <?=$order->shop->address?><br>
		Téléphone: <?=$order->shop->tele?><br>
		Heure d'ouverture: <?=$order->shop->open_hour?>
	</h4>
	Nom:
	<?=$member->firstname?>
	<?=$member->lastname?>
	<br> Téléphone:
	<?=$member->tel?>
	<?php endif;?>
	<br>
	<hr>
	Message:
	<br>
	<?=$order->message?>
</body>
</html>
